package com.chiaching.ums.service.impl;

import com.chiaching.framwork.core.handler.security.SuperMallSecurityUserApi;
import com.chiaching.framwork.domian.bean.SuperMallUserDetail;
import com.chiaching.ums.service.UmsMemberService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author jiajing.he
 * @date 2021/7/27 下午3:11
 */
@RestController
@RequestMapping("/ums/security")
public class SuperMallSecurityUserServerImpl implements SuperMallSecurityUserApi {

    @Resource
    private UmsMemberService umsMemberService;

    @PostMapping("queryById")
    @Override
    public SuperMallUserDetail queryById(@RequestParam(value = "userId")Long userId) {
        return umsMemberService.queryByIdToFramwork(userId);
    }

    @PostMapping("queryByUsername")
    @Override
    public SuperMallUserDetail queryByUsername(@RequestParam(value = "username")String username) {
        return umsMemberService.queryByUsername(username);
    }

}
